import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/hello2")
public class hello_sevrlet2 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //打印在服务器的控制台中
        System.out.println("hello world111");
        //这个是在resp的body中写入一个字符串作为一个响应返回给浏览器页面，在浏览器上显示

        resp.getWriter().write("这是一个doget方法！");
    }
}
